﻿<Window x:Class="StackDeck.Views.ShellView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:cal="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro" 
        Title="StackDeck" Height="768" Width="1024">
    
    <Grid>

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="20" />
        </Grid.RowDefinitions>

        <Grid Grid.Row="0">

            <StackPanel Orientation="Horizontal">
                <TextBlock>Logo</TextBlock>
                <Button x:Name="NewColumn">New Column</Button>
            </StackPanel>

        </Grid>

        <ListBox Grid.Row="1" x:Name="Items" SelectedItem="{Binding SelectedColumn}">
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <VirtualizingStackPanel Orientation="Horizontal" VerticalAlignment="Top" />
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
        </ListBox>

        <ListBox Grid.Row="2" ItemsSource="{Binding Items}" HorizontalAlignment="Center">
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <VirtualizingStackPanel Orientation="Horizontal" />
                </ItemsPanelTemplate>                
            </ListBox.ItemsPanel>
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Button cal:Message.Attach="SelectColumn($dataContext)">Click Me</Button>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>

    </Grid>
    
</Window>